const version = process.argv[process.argv.length - 1].replace(/test/g, '');
console.log(version);

const fs = require('fs');
const path = require('path');

fs.readFile(path.join(__dirname, './src/utils/setting.js'), 'utf8', err => {
	if (err) throw err;

	const newVersion = `export default {
		version: '${version}'
	};`;
	console.log(newVersion);
	fs.writeFile('./src/utils/setting.js', newVersion, 'utf8', err => {
		if (err) throw err;
		console.log('setVersion success done');
	});
});
